let fs = require('fs');

let base_url = "https://gitee.com/songbai_x/bqb_static/raw/master/";
let path = base_url + "files/images_template/"

fs.readFile("../db/image_template.json", function (err, data) {
  if (err) {
    console.log(err)
  }
  data = data.toString()
  let json = JSON.parse(data)
  let type = {}

  json.data.map(e => {
    e.url = path + e.url
    let str = JSON.stringify(e);
    fs.writeFile(`../db/image_template/${e.id}.json`, str, function (err) {
      if (err) {
        console.error(err);
      }
      console.log('----------创建成功-------------');
    })

  })


})